﻿using System;
using System.Configuration;
using System.Reflection;

namespace CarFactory
{
    class Program
    {
        static void Main(string[] args)
        {
            //String FactoryPath=System.Configuration.ConfigurationManager.AppSettings["Factory"];
            //Factory Benzfactory = new Benzactory();
            //Factory BMWfactory = new BMWFactory();
            //Car Benzcar = Benzfactory.BuildCar();
            string FactoryPath =ConfigurationManager.AppSettings["factory"];
            Console.WriteLine(FactoryPath);
            CarFactory factory = (CarFactory)Assembly.Load("CarFactory").CreateInstance(FactoryPath);//映射的实现
            Car car = factory.BuildCar();

        }
    }
}
